import request from './request'
import type { BeautyProject } from '@/types'

export const getProjects = (data: Partial<BeautyProject>) => {
  return request({
    url: '/project/page',
    method: 'post',
    data
  })
}

// projectList
export const getProjectList = () => {
  return request({
    url: '/project/list',
    method: 'post',
    data: {
    }
  })
}

export const getProject = (id: number) => {
  return request({
    url: `/project/query`,
    method: 'post',
    data: {
      id
    }
  })
}

export const createProject = (data: Partial<BeautyProject>) => {
  return request({
    url: '/project/add',
    method: 'post',
    data
  })
}

export const updateProject = (id: number, data: Partial<BeautyProject>) => {
  return request({
    url: `/project/update`,
    method: 'post',
    data
  })
}

export const deleteProject = (id: number) => {
  return request({
    url: `/project/delete`,
    method: 'post',
    data: {
      id
    }
  })
}